package cn.android.weblog;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.StrictMode;
import android.util.Log;

import org.jsoup.Connection;
import org.w3c.dom.ls.LSOutput;

import java.io.IOException;

import cn.android.weblog.util.HttpUtils;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //不写没办法获取到请求
        if (android.os.Build.VERSION.SDK_INT > 9) {
            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
            StrictMode.setThreadPolicy(policy);
        }

        try {
            Connection.Response response = HttpUtils.get("/passage/findPassage/4001");
            System.out.println("===============>"+response.body());
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
